package magicbattle.game.character;

import magicbattle.game.Player;
import magicbattle.game.character.effect.Effect;

public abstract class Skills {

	protected int skillID;
	protected String skillName;

	protected Effect effects[];

	public abstract void action(Player currentPlayer, Target target);

	protected void processAction(Player currentPlayer, Target target) {

		for (Effect effect: this.effects.clone()) {
			// process Effect for selected target
			if (effect.getTargetType() == target.getTargetType()) {
				target.addEffect(currentPlayer, effect);
			}
			// process effect not for selected target
			else {
				switch (effect.getTargetType()) {
				case OWN:
					// create temp target 
					Target ownTarget = new TargetPlayer(currentPlayer);
					ownTarget.addEffect(currentPlayer, effect);
					break;
				default:
					break;
				}
			}
		}
	}

}